if __name__ == '__main__':
    from notifier import Notifier
else:
    from .notifier import Notifier

from win10toast import ToastNotifier as toast
import os


class ToastNotifier(Notifier):

    def __init__(self,*args) -> None:
        super().__init__(*args)
        self.notifier=toast()
    
    def notify(self):
        title='来自🍅⏰的报时🎶'
        message=self.format_msg()
        ico_path=os.path.join(os.path.dirname(__file__),'clock.ico')
        duration=5
        self.notifier.show_toast(title,message,duration=duration,icon_path=ico_path)


if __name__ == '__main__':
    toast=ToastNotifier()
    #同一时间不能发起多个toast通知
    toast.notify()
    toast.notify_async()
    
